{
PROB : subset
LANG : PASCAL
}

program SUBSET;
const
  fi = 'subset.in';
  fo = 'subset.out';
var
  d : array[0..1, 0..780] of longint;
  tren, duoi : longint;
  n : longint;

procedure inp;
begin
  read(n);
end;

procedure process;
var
  i, j : longint;
begin
  tren := 0;
  duoi := 1;
  fillchar(d, sizeof(d), 0);
  d[tren, 0] := 1;
  for i := 1 to n do
  begin
    fillchar(d[duoi], sizeof(d[duoi]), 0);
    for j := 1 to i*(i+1) div 2 do
    begin
      d[duoi, j] := d[tren, j];
      if j >= i then inc(d[duoi, j], d[tren, j-i]);
    end;
    tren := duoi;
    duoi := duoi xor 1;
  end;
end;

procedure out;
begin
  writeln(d[tren, n*(n+1) div 4]);
end;

begin
  assign(input, fi); reset(input);
  assign(output, fo); rewrite(output);

  inp;
  if (n mod 4 = 1) or (n mod 4 = 2) then writeln(0)
  else
  begin
    process;
    out;
  end;

  close(output);
  close(input);
end.
